package com.yuyu.shop.infrastructure.persistence.convert;

import cn.hutool.core.bean.BeanUtil;
import com.yuyu.shop.domain.order.DO.OrderDO;
import com.yuyu.shop.infrastructure.persistence.po.OrderPO;

import java.util.Objects;

/**
 * @author
 * @version 1.0
 * @description: PO2DO
 * @date 2022/8/3 17:17
 */
public class OrderPoConvert {

    public static OrderDO PO2DO(OrderPO po){
      if (Objects.nonNull(po)){
          OrderDO orderDO = new OrderDO();
          BeanUtil.copyProperties(po,orderDO);
          return orderDO;
      }
      return null;
    }

    public static OrderPO DO2PO(OrderDO orderDO){
        if (Objects.nonNull(orderDO)){
            OrderPO orderPO = new OrderPO();
            BeanUtil.copyProperties(orderDO,orderPO);
            return orderPO;
        }
        return null;
    }
}
